import { PluginOption } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import setupUnPlugin from "./unplugin"
import VueDevtools from 'vite-plugin-vue-devtools';
import setupPrismjs from "./prismjs"
import setupVisualizer from "./visualizer"
import setupUnoCss from "./unocss"

export default function createPlugins(){
    const plugins: PluginOption[] = [
        vue({
            template: {
                compilerOptions: {
                    // 将所有带短横线的标签名都视为自定义元素
                    isCustomElement: (tag) => tag.includes('code-input')
                }
            }
        }),
        vueJsx(),
        VueDevtools(),
        setupPrismjs(),
        setupVisualizer(),
        setupUnoCss(),
        ...setupUnPlugin()
    ];
    return plugins
}